package net.crashtoot.picasa.core.dao.impl;

import java.util.ArrayList;
import java.util.List;

import net.crashtoot.picasa.core.dao.AccountDao;
import net.crashtoot.picasa.core.model.Account;

import org.springframework.stereotype.Repository;

@Repository
public class AccountDaoMap implements AccountDao {

    private static final List<Account> ACCOUNTS = new ArrayList<Account>();

    static {
        ACCOUNTS.add(new Account("julienboz", "161080", "crashtete-toot@yahoo.fr"));

        ACCOUNTS.add(new Account("Doan.perso1", "9map174tir", "crashtete-doan1@yahoo.fr"));
        // ACCOUNTS.add(new Account("Doan.2e", "9map174tir", "crashtete-doan2@yahoo.fr"));

        ACCOUNTS.add(new Account("Enoha.Naissance", "9map174tir", "crashtete-enohanaissance@yahoo.fr"));
        ACCOUNTS.add(new Account("Enoha2", "9map174tir", "crashtete-enoha2@yahoo.fr"));
        ACCOUNTS.add(new Account("Enoha.3e4eMois", "9map174tir", "crashtete-enoha3@yahoo.fr"));
        ACCOUNTS.add(new Account("Enoha.5emois", "9map174tir", "crashtete-enoha4@yahoo.fr"));
        ACCOUNTS.add(new Account("Enoha.6e", "9map174tir", "crashtete-enoha5@yahoo.fr"));
        ACCOUNTS.add(new Account("Enoha.5e", "9map174tir", "crashtete-enoha6@yahoo.fr"));
        ACCOUNTS.add(new Account("Enoha.7e", "9map174tir", "crashtete-enoha7@yahoo.fr"));
        // ACCOUNTS.add(new Account("Enoha.8e", "9map174tir", "crashtete-enoha8@yahoo.fr"));
        // ACCOUNTS.add(new Account("Enoha.9e", "9map174tir", "crashtete-enoha9@yahoo.fr"));
        // ACCOUNTS.add(new Account("Enoha.10e", "9map174tir", "crashtete-enoha10@yahoo.fr"));

        ACCOUNTS.add(new Account("julienboz.perso", "9map174tir", "crashtete-perso@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.perso1", "9map174tir", "crashtete-perso1@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.perso2", "9map174tir", "crashtete-perso2@yahoo.fr"));
        ACCOUNTS.add(new Account("julienboz.perso3", "9map174tir", "crashtete-perso3@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.perso4", "9map174tir", "crashtete-perso4@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.perso5", "9map174tir", "crashtete-perso5@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.perso6", "9map174tir", "crashtete-perso6@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.perso7", "9map174tir", "crashtete-perso7@yahoo.fr"));
        // ACCOUNTS.add(new Account("julien.perso8", "9map174tir", "crashtete-perso8@yahoo.fr"));
        // ACCOUNTS.add(new Account("julien.perso9", "9map174tir", "crashtete-perso9@yahoo.fr"));
        // ACCOUNTS.add(new Account("julien.perso10", "9map174tir", "crashtete-perso10@yahoo.fr"));

        ACCOUNTS.add(new Account("julien.autrans", "9map174tir", "crashtete-autrans@yahoo.fr"));
        ACCOUNTS.add(new Account("crashtete.guinea", "9map174tir", "crashtete-guinea@yahoo.fr"));
        ACCOUNTS.add(new Account("julien.lisboa", "9map174tir", "crashtete-lisboa@yahoo.fr"));
        ACCOUNTS.add(new Account("crashtete.burkina", "9map174tir", "crashtete-burkina@yahoo.fr"));
        ACCOUNTS.add(new Account("crashtete.praha", "9map174tir", "crashtete-praha@yahoo.fr"));
    }

    @Override
    public List<Account> listAll() {
        return ACCOUNTS;
    }

    @Override
    public Account getAccountByUserName(String username) {
        for (Account account : ACCOUNTS) {
            if (account.getUsername().equals(username)) {
                return account;
            }
        }
        return null;
    }
}